/*
 * @Description: 
 * @Author: wind-lc
 * @version: 1.0
 * @Date: 2024-03-11 09:23:33
 * @LastEditTime: 2024-03-27 18:07:14
 * @FilePath: \cscec-pms-admin\src\api\businessAffairs\costAccountInit.js
 */
import request from '@/utils/request'
import request2 from '@/utils/request2'
import { faceApiUrl,commonApiUrl} from "../config"

//特殊处理
export function getCostPlanTwo(data) {
  let isShow = data.isShow === false ? false : true;
  return request2({
    url: `${faceApiUrl}/comBusinessCostProjectPlan/queryPlan?projectId=${data.projectId}&isHide=${data.isHide}&isShow=${isShow}`,
    method: 'get',
    data
  })
}
// 获取项目级成本计划信息信息
export function getCostPlan(data) {
  let isShow = data.isShow === false ? false : true;
  return request({
    url: `${faceApiUrl}/comBusinessCostProjectPlan/queryPlan?projectId=${data.projectId}&isHide=${data.isHide}&isShow=${isShow}`,
    method: 'get',
    data
  })
}
// 保存并查询项目成本归集树
export function getQueryAndSaveTreeByType(data) {
  return request({
    url: `${faceApiUrl}/comBusinessCostProjectPlan/queryAndSaveTreeByType?projectId=${data.projectId}&type=${data.type}`,
    method: 'get',
    data
  })
}
// 新增临时科目
export function addProjectTree(data) {
  return request({
    url: `${faceApiUrl}/comBusinessCostProjectTree/addProjectTree`,
    method: 'post',
    data
  })
}
// 删除临时科目
export function deleteProjectTreeById(data) {
  return request({
    url: `${faceApiUrl}/comBusinessCostProjectTree/deleteProjectTreeById?id=${data.id}`,
    method: 'get',
    data
  })
}
// 填报总目标成本数据
export function editProjectTree(data) {
  return request({
    url: `${faceApiUrl}/comBusinessCostProjectPlan/editProjectTree`,
    method: 'post',
    data
  })
}
// 分解目标数据
export function addOrUpdateProjectTreeDetail(data) {
  return request({
    url: `${faceApiUrl}/comBusinessCostProjectTreeDetail/addOrUpdateProjectTreeDetail`,
    method: 'post',
    data
  })
}
// 提交
export function submit(id) {
  return request({
    url: `${faceApiUrl}/comBusinessCostProjectPlan/submit?planId=${id}`,
    method: 'get'
  })
}
// 获取状态
export function queryPlanStatus(id) {
  return request({
    url: `${faceApiUrl}/comBusinessCostProjectPlan/queryPlanStatus?projectId=${id}`,
    method: 'get'
  })
}
// 获取计划数据
export function queryById(id) {
  return request({
    url: `${faceApiUrl}/comBusinessCostProjectPlan/queryById?id=${id}`,
    method: 'get'
  })
}
// 获取计划数据
export function queryPlanOrAdjust(params) {
  // ?projectId = ${ data.projectId }& isHide=${ data.isHide }& isShow=${ data.isShow }
  return request({
    url: `${faceApiUrl}/comBusinessCostProjectPlan/queryPlanOrAdjust`,
    method: 'get',
    params
  })
}
// 初始化上传附件
export function uploadPlanFile(params) {
  return request({
    url: `${commonApiUrl}/comBusinessCostProjectPlan/uploadPlanFile`,
    method: 'get',
    params
  })
}